const store = {
  state: {
    num: 20,
  },
  actions: {
    addPage1(newState: { num: number }) {
      newState.num++;
    },
    addPage12(
      newState: { num: any },
      action: { type?: string; value?: any; val?: any }
    ) {
      newState.num += action.val;
    },
  },
  asyncActions: {
    asyncAddPage1(dispatch: Function) {
      setTimeout(() => {
        dispatch({ type: "addPage1" });
      }, 1000);
    },
  },
  actionsNames: {},
};
let actionsNames = {};
for (const key in store.actions) {
  if (Object.prototype.hasOwnProperty.call(store.actions, key)) {
    // @ts-ignore
    actionsNames[key] = key;
  }
}
store.actionsNames = actionsNames;
export default store;
